package staff

import (
	"duoke/context"
	"github.com/gin-gonic/gin"
	"html/template"
	"net/http"
)

var Index = new(indexCtl)

type indexCtl struct{}

func (ctl *indexCtl) Index(c *gin.Context) {
	t, err := template.ParseFiles("./public/static/staff/index.html")
	if err != nil {
		c.String(http.StatusOK, "模板不存在")
		return
	}
	// 渲染模板
	err = t.Execute(c.Writer, gin.H{"api_url": context.Global.Domain})
	if err != nil {
		c.String(http.StatusOK, "模板解析失败")
	}
}
